﻿using System.Web;
using System.Web.Compilation;
using System.Web.Routing;
using System.Web.UI;

namespace PhuLeBooze.Global
{
    public class CRoutePageHandler: IRouteHandler
    {
        private string _virtualPath;

        public CRoutePageHandler(string virtualPath)
        {
            _virtualPath = virtualPath;
        }

        public IHttpHandler GetHttpHandler(RequestContext requestContext)
        {
            var display = BuildManager.CreateInstanceFromVirtualPath(_virtualPath, typeof(Page)) as Page;
            return display;
        }
    }
}